package com.lkd.mapper;

import com.lkd.dto.RegionDto;
import com.lkd.entity.Node;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NodeMapper {
    List<Node> findList(RegionDto regionDto);

    @Select("select count(*) from tb_node where region_id = #{regionId}")
    Integer countByRegionId(Long id);

    boolean addNode(Node node);

    boolean updateNode(Node node);

    boolean deleteNode(Long nodeId);

    @Select("select * from tb_node where id = #{nodeId}")
    Node findById(Long nodeId);
}
